// JavaScript Document
var gft = null;
var gfxspeed=5;
var gfyspeed=5;
function Gift() {
    if (FS==300){
        myStage.addChild(gf);

        gft = setTimeout(function () {
            gf.x = gf.x + gfxspeed;
            gf.y = gf.y + gfyspeed;

            if (gf.x < 0) { gfxspeed = 5; }
            if (gf.x > 350) { gfxspeed = -5; }
            if (gf.y < 0) { gfyspeed = 5; }
            if (gf.y > 750) { gfyspeed = -5; }
        },50)

	}
	if(fj.x-gf.x>-80&&fj.x-gf.x<10&&fj.y-gf.y>-80&&fj.y-gf.y<10)
	{
		myStage.removeChild(gf);
		num=num+1000;
		FS=num;
		}

	}